home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 May / 1986-05.d64 / word count (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  956b  |  38 lines

  1. 10 print"[147][159]"chr$(142):bs=828:poke53280,6:poke53281,6
  2. 20 i=i+1:reada:ifa<0then50
  3. 30 pokebs+1+i,a
  4. 40 goto20
  5. 50 z=0:d$=""
  6. 60 print"[147]press d for directory"
  7. 70 geta$:ifa$=""then70
  8. 80 ifa$<>"d"then160
  9. 90 open1,8,0,"$0"
  10. 100 print:fora=1to32:get#1,c$:next
  11. 110 get#1,b$:ifst<>0thenclose1:sys65484:goto160
  12. 120 ifb$<>chr$(34)then110
  13. 130 get#1,b$:ifb$<>chr$(34)thend$=d$+b$:goto130
  14. 140 get#1,b$:ifb$=chr$(32)then140
  15. 150 print" ";b$;"   ";d$:d$="":goto110
  16. 160 input"file name";f$
  17. 170 iff$=""thenprint"[145][145][145][145]":goto160
  18. 180 print"[147]file type?"
  19. 190 print"p[146]rogram"
  20. 200 print"s[146]equential"
  21. 210 getg$:ifg$<>"p"andg$<>"s"then210
  22. 220 print"counting"
  23. 230 ifg$="s"then250
  24. 240 open1,8,0,f$+",p,r":goto260
  25. 250 open1,8,0,f$+",s,r"
  26. 260 sysbs+2
  27. 270 z=peek(bs)+256*peek(bs+1)+2
  28. 280 print"[147]number of words:"z:close1
  29. 290 open15,8,15,"i0":close15
  30. 300 print"another file?  (y/n)
  31. 310 [161]a$:[139]a$[178]"y"[167]50
  32. 320 [139]a$[178]"n"[167][128]
  33. 330 [137]310
  34. 340 [131]169,0,141,58,3,141,59,3,141,60,3,141,61,3,162,1,32,198,255,32
  35. 350 [131]183,255,41,64,208,34,32,207,255,141,58,3,201,32,208,15,32,207,255
  36. 360 [131]201,32,240,8,238,60,3,208,3,238,61,3,173,58,3,141,59,3,76,81
  37. 370 [131]3,32,231,255,96,-1
  38.